package com.course.redis.controller;

import com.course.common.model.pojo.SeckillVouchers;
import com.course.common.response.BaseResponse;
import com.course.redis.service.SeckillService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @PROJECT_NAME: course
 * @DESCRIPTION:
 * @Author: 涂玄武
 * @DATE: 2021/6/25 10:06
 */
@RestController
public class SeckillController {

    @Resource
    private SeckillService seckillService;

    /**
     * 新增秒杀活动
     *
     * @param seckillVouchers
     * @return
     */
    @PostMapping("add")
    public BaseResponse addSeckillVouchers(@RequestBody SeckillVouchers seckillVouchers) {
        seckillService.addSeckillVouchers(seckillVouchers);
        return new BaseResponse().success("添加成功");
    }

}
